using JT808Protocol.Common;
using System;

namespace JT808Protocol.Models.BodyParserStrategy.Location.LocationAddition
{
    /// <summary>
    /// (ADAS,DSM,BSD,TPMS)报警信息数据格式
    /// </summary>
    public class LaAlarmLogo_Yue : AlarmLogo
    {
        public LaAlarmLogo_Yue()
        {
            OriginalData = new byte[40];
        }

        public override void ReadEntity(ReadOnlySpan<byte> readBuffer, ref int startIndex)
        {
            //终端ID
            DeviceID = ParseHelper.Gb2312String(ref readBuffer, startIndex, 30);
            startIndex += 30;
            //时间
            Time = ParseHelper.BcdTo1078Datetime(ref readBuffer, startIndex);
            startIndex += 6;
            //序号
            Sn = readBuffer[startIndex];
            startIndex++;
            //附件数量
            AttachmentCount = readBuffer[startIndex];
            //跳过预留
            startIndex += 3;
        }
    }
}